/*
 * @Author: pengtianrui 2276608413@qq.com
 * @Date: 2024-08-22 17:08:34
 * @LastEditors: Wang Shuo wangshuo@sgsimulation.com
 * @LastEditTime: 2024-08-30 13:41:34
 * @FilePath: \SGFEM\DataStructure\FEM\Material\src\Orthotropic2DMaterial.cpp
 */
#include "DataStructure/Input/Material/Orthotropic2DMaterial.h"

#include "DataStructure/Common/Validation.h"

bool SG::DataStructure::FEM::operator== (const Orthotropic2DMaterial& a, const Orthotropic2DMaterial& b)
{
    if (a.m_domainId != b.m_domainId)
    {
        return false;
    }
    if (a.m_id != b.m_id)
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_tref, b.m_tref))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_E1, b.m_E1))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_E2, b.m_E2))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_nu12, b.m_nu12))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_G12, b.m_G12))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_G1Z, b.m_G1Z))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_G2Z, b.m_G2Z))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_rho, b.m_rho))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_A1, b.m_A1))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_A2, b.m_A2))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_XT, b.m_XT))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_XC, b.m_XC))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_YT, b.m_YT))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_YC, b.m_YC))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_S, b.m_S))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_ge, b.m_ge))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_F12, b.m_F12))
    {
        return false;
    }
    if (!SG::DataStructure::Common::isNear (a.m_Strn, b.m_Strn))
    {
        return false;
    }

    for (int i = 0; i < 6; ++i)
    {
        if (a.m_HFAILFactor[i] != b.m_HFAILFactor[i])
        {
            return false;
        }
    }
    for (int i = 0; i < 9; ++i)
    {
        if (a.m_HTAPEFactor[i] != b.m_HTAPEFactor[i] || a.m_HFABRFactor[i] != b.m_HFABRFactor[i])
        {
            return false;
        }
    }

    return true;
}